<template>
    <el-drawer v-model="visible" direction="rtl" destroy-on-close :size="800">
        <template #header>
            <h2 class="title">{{ 'title' }}</h2>
        </template>
        <template #default>
            demo组件
        </template>
        <template #footer>
            <el-button type="primary">{{ 'saveBtnText' }}</el-button>
        </template>
    </el-drawer>
</template>


<script setup>
import { inject, ref } from 'vue'

const emits = defineEmits(['command'])
const { components } = inject('schemaViewData')

const name = ref('demoComponent')
const visible = ref(false)
const title = ref("")
const saveBtnText = ref("")

const show = (rowData) => {
    visible.value = true
    const { config } = components.value[name.value]
    title.value = config.title
    saveBtnText.value = config.saveBtnText
}

defineExpose({
    name,
    show
})
</script>


<style lang='less' scoped></style>